import { http } from "@/utils/http";
import httpConfig from "@/utils/http/httpConfig";
const prefix = httpConfig.pms;

/**
 * 获取 销售属性列表
 * @param params
 */
export function AttrList(params?: Record<string, any>) {
  return http.get(prefix + "/attr/list", { params });
}

/**
 * 添加 销售属性
 * @param params
 * @returns {*}
 */
export function AttrAdd(params: Record<string, any>) {
  return http.post(prefix + "/attr", { data: params });
}

/**
 * 修改 销售属性
 * @param params
 * @returns {*}
 */
export function AttrEdit(params: Record<string, any>) {
  return http.post(prefix + "/attr/edit", { data: params });
}

/**
 * 删除 销售属性
 * @param params
 * @returns {*}
 */
export function AttrDelete(params: Record<string, any>) {
  return http.post(prefix + "/attr/del", { data: params });
}

/**
 * 获取详情 销售属性
 * @param params
 * @returns {*}
 */
export function AttrDetail(params: any) {
  return http.get(prefix + "/attr/" + params);
}

/**
 * 获取分组下的属性
 * @param params
 * @returns
 */
export function getAttrByGroup(params: any) {
  return http.post(prefix + "/attr/getAttrByGroup", { data: params });
}

/**
 * 获取 销售属性列表
 * @param params
 */
export function AttrGroupList(params?: Record<string, any>) {
  return http.get(prefix + "/attr/group/list", { params });
}

/**
 * 添加 销售属性
 * @param params
 * @returns {*}
 */
export function AttrGroupAdd(params: Record<string, any>) {
  return http.post(prefix + "/attr/group", { data: params });
}

/**
 * 修改 销售属性
 * @param params
 * @returns {*}
 */
export function AttrGroupEdit(params: Record<string, any>) {
  return http.post(prefix + "/attr/group/edit", { data: params });
}

/**
 * 删除 销售属性
 * @param params
 * @returns {*}
 */
export function AttrGroupDelete(params: Record<string, any>) {
  return http.post(prefix + "/attr/group/del", { data: params });
}

/**
 * 获取详情 销售属性
 * @param params
 * @returns {*}
 */
export function AttrGroupDetail(params: any) {
  return http.get(prefix + "/attr/group/" + params);
}
